<layout name="layout" />

<!-- 搜索 -->
<div class="form-div search_form_div">
    <form action="__ACTION__" method="GET" name="search_form">
		<p>
			课程名：
	   		<input type="text" name="course_name" size="30" value="<?php echo I('get.course_name'); ?>" />
		</p>
		<p>
			开始时间：
	   		从 <input id="start_timefrom" type="text" name="start_timefrom" size="15" value="<?php echo I('get.start_timefrom'); ?>" />
		    到 <input id="start_timeto" type="text" name="start_timeto" size="15" value="<?php echo I('get.start_timeto'); ?>" />
		</p>
		<p>
			结束时间：
	   		从 <input id="start_timefrom1" type="text" name="start_timefrom" size="15" value="<?php echo I('get.start_timefrom'); ?>" />
		    到 <input id="start_timeto1" type="text" name="start_timeto" size="15" value="<?php echo I('get.start_timeto'); ?>" />
		</p>
		<p>
			课程地点：
	   		<input type="text" name="course_addr" size="30" value="<?php echo I('get.course_addr'); ?>" />
		</p>
		<p>
			教室：
			<?php buildSelect('classroom','classroom_id','id','classroom_name'); ?>
		</p>
		<p>
			教师：
			<?php buildSelect('teacher','teacher_id','id','teacher_name'); ?>
		</p>
		<p>
			是否显示：
	   		<input type="text" name="is_show" size="30" value="<?php echo I('get.is_show'); ?>" />
		</p>
		<p>
			<input type="submit" value=" 搜索 " class="button btn btn-info" />
			<button type="button" class="btn btn-info " style="float: right;" id="btn">导出本页课程为表格</button>
		</p>
    </form>
</div>
<!-- 列表 -->
<div class="list-div table2excel" id="listDiv">
	<table cellpadding="3" cellspacing="1">
    	<tr>
            <th >排序</th>
            <th >课程名</th>
            <th >课程展示名</th>
            <th >课程开始时间</th>
            <th >课程结束时间</th>
            <th >课程等级</th>
            <th >课程价格</th>
            <th >课程体验价格</th>
            <th >课程备注</th>
            <th >课程地点</th>
            <th >教室ID</th>
            <th >教师ID</th>
            <th >分类ID</th>
            <th > 上课积分</th>
            <th >是否显示</th>
            <th >封面图片</th>
			<th width="120" class="noExl">操作</th>
        </tr>
		<?php foreach ($data as $k => $v): ?>            
			<tr class="tron">
				<td  height="60"><?php echo $v['sort']; ?></td>
				<td><?php echo $v['course_name']; ?></td>
				<td><?php echo $v['course_show_name']; ?></td>
				<td><?php echo $v['start_time']; ?></td>
				<td><?php echo $v['end_time']; ?></td>
				<td><?php echo $v['course_level']; ?></td>
				<td><?php echo $v['course_price']; ?></td>
				<td><?php echo $v['course_exp_price']; ?></td>
				<td><?php echo $v['course_comment']; ?></td>
				<td><?php echo $v['course_addr']; ?></td>
				<td><?php getIdByName('classroom',$v['classroom_id'],'classroom_name'); ?></td>
				<td><?php getIdByName('teacher',$v['teacher_id'],'teacher_name'); ?></td>
				<td><?php getIdByName('course',$v['cat_id'],'course_name'); ?></td>
				<td><?php echo $v['jifen']; ?></td>
				<td><?php if($v['is_show'] == 1) echo '是'; else echo '否' ?></td>
				<td><?php showImage($v['sm_logo']); ?></td>
		        <td align="center" class="noExl">
		        	<a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" title="编辑">编辑</a> |
	                <a href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p')); ?>" onclick="return confirm('确定要删除吗？');" title="移除">移除</a> 
		        </td>
	        </tr>
        <?php endforeach; ?> 
		<?php if(preg_match('/\d/', $page)): ?>  
        <tr><td align="right" nowrap="true" colspan="99" height="30"><?php echo $page; ?></td></tr> 
        <?php endif; ?> 
	</table>
</div>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/jquery.table2excel.js"></script>

<script>

    $(function() {
        $("#btn").click(function(){
            $(".table2excel").table2excel({
                exclude: ".noExl",
                name: "Excel Document Name",
                filename: "课程表列表",
                exclude_img: true,
                exclude_links: true,
                exclude_inputs: true
            });
        });

    });

</script>
<link href="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/datetimepicker/datepicker-zh_cn.js"></script>
<link rel="stylesheet" media="all" type="text/css" href="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/jquery-ui-timepicker-addon.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/datetimepicker/time/i18n/jquery-ui-timepicker-addon-i18n.min.js"></script>
<script>$.timepicker.setDefaults($.timepicker.regional['zh-CN']);</script>
		<script>


			  $(document).ready(function() {
       
$('#start_timefrom').datetimepicker();
$('#start_timeto').datetimepicker();
$('#start_timefrom1').datetimepicker();
$('#start_timeto1').datetimepicker();
		   });
</script>


<script src="__PUBLIC__/Admin/Js/tron.js"></script>